<?php

use Phalcon\Mvc\Application;

error_reporting(E_ALL);

try {
    $runtime = 'dev';
    define('RUNTIME', $runtime);
    /** 定义常量 */
    define('ROOT_PATH',dirname(__DIR__));
    
   /**  引入配置文件  */
    include ROOT_PATH . '/app/config/conf.php';

    /**  加载命名空间 */
    include ROOT_PATH . '/app/core/loader.php';

    /** 注册 服务*/
    require ROOT_PATH . '/app/core/services.php';
   
    /**
     * Handle the request
     */
    $application = new Application($di);
    
    /**
     * Include modules
     */
    $application->registerModules(
        [
            'home' => [
                "className" => 'Gmm\\App\\Mvc\\Home\\Module',
                "path"      => ROOT_PATH . "/app/mvc/home/Module.php",
            ],
            'admin' =>  [
                "className" => 'Gmm\App\Mvc\Admin\Module',
                "path"      => ROOT_PATH . "/app/mvc/home/Module.php",
            ],
        ]
    );

    $response = $application->handle();
    echo $response->getContent();
} catch (Exception $e) {
    echo $e->getMessage();
}
